<template>
	<view>
		<wzk-wrongTopic :list="list"></wzk-wrongTopic>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				postId:0,
				list:[]
			}
		},
		onLoad(option) {
			
			uni.showLoading({
				title: '请稍等...',
				mask: true
			})
			this.postId = option.postId || '18'
			this.getList();
		},
		methods: {
			// getList(){
			// 	this.$http.get('app/preschoolController/selectAnswerSheetList',{postId:this.postId}, true, true).then(res=>{
					
			// 	})
			// },
			getList() {
				this.$http.get('app/preschoolController/selectAnswerSheetList', {
					postId: this.postId
				}, true, true).then(res => {
					if(res.code==200){
						uni.showLoading({
							title: '请稍等...',
							mask: true
						})
						res.data.forEach((e, index) => {
							if (e) {
								e.selectText = e.answerUser
								e.type = e.types
								if (e.types == 1 || e.types == 2) {
									e.title = e.subjectname
									e.selectA = e.optiona
									e.selectB = e.optionb
									e.selectC = e.optionc
									e.selectD = e.optiond
									e.confirmSelect = e.correctoption
								} else {
									e.title = e.subjectname
									e.confirmSelect = e.correctoption == '正确' ? 'true' : 'false'
								}
								this.list.push(e)
							}
							if ((index + 1) >= res.data.length) {
								uni.hideLoading();
							}
						})
					}else{
						uni.hideLoading();
					}
				}).catch(err=>{
					uni.hideLoading();
				})
			},
		}
	}
</script>

<style>

</style>
